#ifndef _Tools_
#define _Tools_
#include <Windows.h>
#include <new>
#include <d3d9.h>
#include <d3dx9.h>
#include <time.h> 
#include <fstream>
#define MASKVALUE   0x12345678
#define KEYVALUE	0x13

class cTools{
public:
	VOID MemPatch(PUCHAR dest, CONST PUCHAR src, INT len);
	VOID MemSet(PBYTE dest, INT val, INT len);
	VOID DirectMemAlloc(PUCHAR dest, INT len);
	VOID MemXorJmp(DWORD adr, DWORD cavefunc);
	DWORD MemHotPatch(DWORD adr, DWORD caveadr, bool dip_activate = 0);
	bool bCompare(CONST PBYTE pData, CONST PBYTE bMask, CONST PCHAR szMask);
	DWORD FindPattern(DWORD dwAddress, DWORD dwLen, PBYTE bMask,PCHAR szMask);
	DWORD** FindDevice(VOID);
	DWORD FindAPI(CONST PCHAR DLLName, CONST PCHAR FunctionName);
	
	VOID XorStr(char* str, int key = KEYVALUE);
	char* WINAPI GetFrameRate();
	HRESULT GenerateTexture(IDirect3DDevice9 *pD3Ddev, IDirect3DTexture9 **ppD3Dtex, DWORD colour32);
	VOID DrawTxt(INT X, INT Y, D3DCOLOR Color, ID3DXFont *font, CONST PCHAR Text, DWORD flag = 0) ;

	cTools( VOID ){ memset(dllfn, 0, 301); memset(logfn, 0, 301); }
	CHAR dllfn[301];	
	CHAR logfn[301];
private:
	PUCHAR DirectMemAllocMemPtr;

};
#endif _Tools_